package com.isczy.staservice.schedule;

import cn.hutool.core.date.DateUtil;
import com.isczy.staservice.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class ScheduledTask {

    @Autowired
    private StatisticsDailyService staService;

    /***
     * ***************************************
     * 功能描述:在每天凌晨1点，把前一天数据进行数据查询添加
     * @param
     * @return
     * @author create: TODO 人员:【ChangZiYang】类型:【新增方法】日期:【2021-01-23 10:16】
     * @author modify:
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void registerCount() {
        staService.registerCount(DateUtil.yesterday().toString("yyyy-MM-dd"));
    }
}
